﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.ServiceModel.Web;
using System.Text;

namespace WCFObserver
{
    [ServiceContract(CallbackContract = typeof(IWcfObserverClientFeed))]


    public interface IWCFObserver
    {
        [OperationContract]
        void Subscribe();

        [OperationContract]
        void Unsubscribe();
    }

    public interface IWcfObserverClientFeed
    {
        [OperationContract(IsOneWay = true)]
        void OnCompleted();
        [OperationContract(IsOneWay = true)]
        void OnError(Exception error);
        [OperationContract(IsOneWay = true)]
        void OnNext(EventType value);
    }




    // Use a data contract as illustrated in the sample below to add composite types to service operations.
    [DataContract]
    public class EventType
    {

        [DataMember]
        public int offender { get; set; }
        [DataMember]
        public DateTime time { get; set; }
        [DataMember]
        public Double lon { get; set; }
        [DataMember]
        public Double lat { get; set; }
        [DataMember]
        public Double direction { get; set; }
    }
}
